Feature/pre registration#144
Conversation
|
Warning Review limit reached
Next review available in: 19 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthrough사전 등록(pre_registration) 도메인에 사용자 관리와 이메일 발송 기능이 추가되고, 관련 마이그레이션 및 테스트가 도입되었습니다. 아울러 다수 모듈에서 라우터 export 방식 통일, HTTP 상태코드 상수화, 미사용 import 제거, 예외 메시지/포맷 정리 등 광범위한 정리 작업이 수행되었습니다. Changes사전 등록 사용자 및 이메일 발송 기능
Estimated code review effort: 3 (Moderate) | ~30 minutes 라우터 export 통일, import 정리 및 기타 리팩터링
Estimated code review effort: 2 (Simple) | ~15 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
wacruit/src/apps/portfolio/file/repositories.py (1)
28-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value불필요해진 pylint disable 주석 제거 필요.
# pylint: disable=singleton-comparison는is_uploaded == True비교로 인한 경고를 억제하기 위한 것이었으나, 이제 불리언 컬럼을 직접 조건으로 사용하도록 변경되어 더 이상 해당 경고가 발생하지 않습니다. 남겨진 disable 주석은 향후 이 스코프 내 실제 위반을 가릴 수 있으므로 제거하는 것이 좋습니다.♻️ 제안
def get_portfolio_files( self, user_id: int, recruiting_id: int ) -> Sequence[PortfolioFile]: - # pylint: disable=singleton-comparison query = select(PortfolioFile).where( (PortfolioFile.user_id == user_id) & (PortfolioFile.recruiting_id == recruiting_id) & PortfolioFile.is_uploaded )🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@wacruit/src/apps/portfolio/file/repositories.py` around lines 28 - 32, Remove the no-longer-needed pylint suppression from the repository query in PortfolioFileRepository, since PortfolioFile.is_uploaded is now used directly and no singleton-comparison warning is expected. Keep the select(PortfolioFile).where(...) logic unchanged, and delete only the "# pylint: disable=singleton-comparison" comment near the query construction.wacruit/src/apps/pre_registration/schemas.py (1)
51-57: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win
content/html_content에 길이 제한이 없습니다.
subject는max_length=255가 있는데content/html_content는 상한이 없습니다. 관리자 전용 엔드포인트라 위험은 낮지만, 다른 필드들과 일관되게 상한을 두면 외부 메일 제공자로 과도하게 큰 페이로드가 전달되는 것을 방지할 수 있습니다.♻️ 제안
subject: str = Field(..., min_length=1, max_length=255) - content: str = Field(..., min_length=1) - html_content: str | None = None + content: str = Field(..., min_length=1, max_length=10000) + html_content: str | None = Field(default=None, max_length=20000)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@wacruit/src/apps/pre_registration/schemas.py` around lines 51 - 57, `SendPreRegistrationEmailRequest`의 `content`와 `html_content`에 상한 길이가 없어 대용량 페이로드가 들어갈 수 있습니다. 이 스키마에서 `subject`처럼 `Field`에 적절한 `max_length`를 추가해 두 필드의 길이 제한을 맞추고, 관리자용 엔드포인트에서도 외부 메일 전송 전 입력 크기를 제어하도록 수정하세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@wacruit/src/apps/pre_registration/services.py`:
- Around line 150-181: The send_email_to_pre_registration_users flow is doing
bulk delivery synchronously in the request path, which can block the API and
exhaust workers as recipient counts grow. Update
SendPreRegistrationEmailResponse handling so
send_email_to_pre_registration_users in services.py hands off delivery work to
BackgroundTasks or a queue-based worker instead of looping over all users
inline, and add a recipient cap or batching in get_pre_registration_users usage
to prevent unbounded sends. Keep the existing email_service.send_email logic,
but move the execution out of the HTTP request lifecycle.
---
Nitpick comments:
In `@wacruit/src/apps/portfolio/file/repositories.py`:
- Around line 28-32: Remove the no-longer-needed pylint suppression from the
repository query in PortfolioFileRepository, since PortfolioFile.is_uploaded is
now used directly and no singleton-comparison warning is expected. Keep the
select(PortfolioFile).where(...) logic unchanged, and delete only the "# pylint:
disable=singleton-comparison" comment near the query construction.
In `@wacruit/src/apps/pre_registration/schemas.py`:
- Around line 51-57: `SendPreRegistrationEmailRequest`의 `content`와
`html_content`에 상한 길이가 없어 대용량 페이로드가 들어갈 수 있습니다. 이 스키마에서 `subject`처럼 `Field`에 적절한
`max_length`를 추가해 두 필드의 길이 제한을 맞추고, 관리자용 엔드포인트에서도 외부 메일 전송 전 입력 크기를 제어하도록 수정하세요.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 29ff490a-66e2-470b-9ab4-7372e1d7e9e9
📒 Files selected for processing (97)
pyproject.tomlwacruit/src/apps/announcement/__init__.pywacruit/src/apps/announcement/models.pywacruit/src/apps/announcement/repositories.pywacruit/src/apps/common/schemas.pywacruit/src/apps/dummy/__init__.pywacruit/src/apps/faq/__init__.pywacruit/src/apps/faq/repositories.pywacruit/src/apps/faq/views.pywacruit/src/apps/history/__init__.pywacruit/src/apps/history/repositories.pywacruit/src/apps/history/services.pywacruit/src/apps/hodu/config.pywacruit/src/apps/hodu/repositories.pywacruit/src/apps/hodu/schemas.pywacruit/src/apps/judge/repositories.pywacruit/src/apps/member/__init__.pywacruit/src/apps/member/models.pywacruit/src/apps/member/views.pywacruit/src/apps/portfolio/file/aws/s3/client.pywacruit/src/apps/portfolio/file/aws/s3/utils.pywacruit/src/apps/portfolio/file/exceptions.pywacruit/src/apps/portfolio/file/repositories.pywacruit/src/apps/portfolio/file/services.pywacruit/src/apps/portfolio/file/services_v2.pywacruit/src/apps/portfolio/file/views_v2.pywacruit/src/apps/portfolio/url/exceptions.pywacruit/src/apps/portfolio/url/repositories.pywacruit/src/apps/pre_registration/__init__.pywacruit/src/apps/pre_registration/exceptions.pywacruit/src/apps/pre_registration/models.pywacruit/src/apps/pre_registration/repositories.pywacruit/src/apps/pre_registration/schemas.pywacruit/src/apps/pre_registration/services.pywacruit/src/apps/pre_registration/views.pywacruit/src/apps/problem/__init__.pywacruit/src/apps/problem/exceptions.pywacruit/src/apps/problem/models.pywacruit/src/apps/problem/repositories.pywacruit/src/apps/problem/repositories_v2.pywacruit/src/apps/problem/schemas_v2.pywacruit/src/apps/problem/services.pywacruit/src/apps/problem/services_v2.pywacruit/src/apps/problem/utils.pywacruit/src/apps/problem/utils_v2.pywacruit/src/apps/project/__init__.pywacruit/src/apps/project/exceptions.pywacruit/src/apps/project/models.pywacruit/src/apps/project/repositories.pywacruit/src/apps/project/services.pywacruit/src/apps/recruiting/__init__.pywacruit/src/apps/recruiting/models.pywacruit/src/apps/recruiting/views.pywacruit/src/apps/recruiting_info/models.pywacruit/src/apps/resume/__init__.pywacruit/src/apps/resume/models.pywacruit/src/apps/resume/repositories.pywacruit/src/apps/resume/schemas.pywacruit/src/apps/resume/services.pywacruit/src/apps/resume/views.pywacruit/src/apps/review/__init__.pywacruit/src/apps/review/models.pywacruit/src/apps/review/repositories.pywacruit/src/apps/seminar/__init__.pywacruit/src/apps/seminar/repositories.pywacruit/src/apps/seminar/schemas.pywacruit/src/apps/seminar/views.pywacruit/src/apps/sponsor/__init__.pywacruit/src/apps/timeline/__init__.pywacruit/src/apps/timeline/exceptions.pywacruit/src/apps/timeline/repositories.pywacruit/src/apps/timeline/services.pywacruit/src/apps/user/__init__.pywacruit/src/apps/user/dependencies.pywacruit/src/apps/user/exceptions.pywacruit/src/apps/user/repositories.pywacruit/src/apps/user/services.pywacruit/src/database/base.pywacruit/src/database/connection.pywacruit/src/database/migrations/versions/2026_06_28_1700-8c4d2f1a6b7e_add_pre_registration_active_key.pywacruit/src/database/migrations/versions/2026_06_29_1000-4b0f9d2e7a61_add_pre_registration_user_table.pywacruit/src/tests/announcement/conftest.pywacruit/src/tests/announcement/test_announcement_service.pywacruit/src/tests/announcement/test_announcement_views.pywacruit/src/tests/conftest.pywacruit/src/tests/faq/conftest.pywacruit/src/tests/faq/test_faq_service.pywacruit/src/tests/portfolio/file/conftest.pywacruit/src/tests/portfolio/url/test_portfolio_url_service.pywacruit/src/tests/pre_registration/conftest.pywacruit/src/tests/pre_registration/test_pre_resgistration_service.pywacruit/src/tests/resume/test_resume_service.pywacruit/src/tests/seminar/test_seminar_service.pywacruit/src/tests/timeline/conftest.pywacruit/src/tests/user/conftest.pywacruit/src/tests/user/test_user_service.pywacruit/src/utils/mixins.py
💤 Files with no reviewable changes (23)
- wacruit/src/apps/problem/utils.py
- wacruit/src/apps/member/views.py
- wacruit/src/apps/problem/utils_v2.py
- wacruit/src/apps/member/models.py
- wacruit/src/tests/seminar/test_seminar_service.py
- wacruit/src/apps/portfolio/file/views_v2.py
- wacruit/src/tests/user/conftest.py
- wacruit/src/apps/review/models.py
- wacruit/src/tests/resume/test_resume_service.py
- wacruit/src/apps/timeline/services.py
- wacruit/src/apps/seminar/schemas.py
- wacruit/src/database/connection.py
- wacruit/src/tests/faq/test_faq_service.py
- wacruit/src/tests/timeline/conftest.py
- wacruit/src/apps/user/services.py
- wacruit/src/apps/resume/views.py
- wacruit/src/tests/announcement/conftest.py
- wacruit/src/apps/problem/schemas_v2.py
- wacruit/src/apps/user/exceptions.py
- wacruit/src/apps/resume/schemas.py
- wacruit/src/apps/history/services.py
- wacruit/src/apps/recruiting_info/models.py
- pyproject.toml
Summary
ruff,pyright오류를 정리했습니다.API
POST /api/v3/pre-registration/usersGET /api/v3/pre-registration/users?active_only=truePOST /api/v3/pre-registration/users/email